package com.sc.fs3.pojo;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.time.LocalDateTime;

/**
 * 文件实体
 */
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Document(indexName = "mhg_doc")
public class FileEntity {

    @Id
    private String id;           //唯一标识


    @Field(type = FieldType.Text,analyzer = "ik_smart",
            searchAnalyzer = "ik_smart")
    private String title;      //标题


    @Field(type = FieldType.Text,analyzer = "ik_smart",
            searchAnalyzer = "ik_smart")
    private String content;    //文件内容


    @Field(type = FieldType.Long)
    private Long size;         //文件大小


    @Field(type = FieldType.Date,
            format = DateFormat.basic_date_time)
    private LocalDateTime uploadtime;   //上传时间


}
